package com.pk.platform.business.data.web;

import com.pk.platform.business.core.web.GenericAction;
import com.pk.platform.business.data.service.IBaseDataService;
import com.pk.platform.business.data.vo.BaseDataVO;
import com.pk.platform.domain.data.BaseData;

public class BaseDataAction extends GenericAction {

	private IBaseDataService baseDataService;
	
	private BaseData bd = new BaseData();
	
	private BaseDataVO bvo = new BaseDataVO();
	
	private boolean addBaseDataFlag = false;
	
	private String beforePid;
	
	private String[] bdIds;
	
	public String queryBaseData()
	{
		lp = baseDataService.queryBaseData(bvo, pager);
		return SUCCESS;
	}
	
	public String toAddBaseData()
	{
		return SUCCESS;
	}

	public String addBaseData()
	{
		addBaseDataFlag = baseDataService.addBaseData(bd);
		return SUCCESS;
	}
	
	public String toUpdateBaseData()
	{
		bd = baseDataService.queryBaseDataById(bd.getId());
		return SUCCESS;
	}
	
	public String updateBaseData()
	{
		baseDataService.updateBaseData(bd);
		return SUCCESS;
	}
	
	public String delBaseDatas()
	{
		baseDataService.delBaseDatas(bdIds);
		return SUCCESS;
	}

	public IBaseDataService getBaseDataService() {
		return baseDataService;
	}

	public void setBaseDataService(IBaseDataService baseDataService) {
		this.baseDataService = baseDataService;
	}

	public BaseData getBd() {
		return bd;
	}

	public void setBd(BaseData bd) {
		this.bd = bd;
	}

	public BaseDataVO getBvo() {
		return bvo;
	}

	public void setBvo(BaseDataVO bvo) {
		this.bvo = bvo;
	}

	public boolean isAddBaseDataFlag() {
		return addBaseDataFlag;
	}

	public void setAddBaseDataFlag(boolean addBaseDataFlag) {
		this.addBaseDataFlag = addBaseDataFlag;
	}

	public String getBeforePid() {
		return beforePid;
	}

	public void setBeforePid(String beforePid) {
		this.beforePid = beforePid;
	}

	public String[] getBdIds() {
		return bdIds;
	}

	public void setBdIds(String[] bdIds) {
		this.bdIds = bdIds;
	}
	
}
